classDiagram
    class AbstractFactory {
        <<interface>>
        +createProductA(): AbstractProductA
        +createProductB(): AbstractProductB
    }
    class ConcreteFactory1 {
        +createProductA(): ConcreteProductA
        +createProductB(): ConcreteProductB
    }
    class ConcreteFactory2 {
        +createProductA(): ConcreteProductA
        +createProductB(): ConcreteProductB
    }
    class AbstractProductA {
        <<interface>>
        +use(): void
    }
    class ConcreteProductA1 {
        +use(): void
    }
    class ConcreteProductA2 {
        +use(): void
    }
    class AbstractProductB {
        <<interface>>
        +use(): void
    }
    class ConcreteProductB1 {
        +use(): void
    }
    class ConcreteProductB2 {
        +use(): void
    }

    AbstractFactory <|-- ConcreteFactory1
    AbstractFactory <|-- ConcreteFactory2
    AbstractProductA <|.. ConcreteProductA1
    AbstractProductA <|.. ConcreteProductA2
    AbstractProductB <|.. ConcreteProductB1
    AbstractProductB <|.. ConcreteProductB2
    ConcreteFactory1 ..> ConcreteProductA1 : Creates
    ConcreteFactory1 ..> ConcreteProductB1 : Creates
    ConcreteFactory2 ..> ConcreteProductA2 : Creates
    ConcreteFactory2 ..> ConcreteProductB2 : Creates
